<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<%-- S 弹出框  --%>
<div class="modal fade js_myDataSave_popup" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
 com="myDataSave" 
 bindBeforeAction="@fun:fun_before_save()" 
 bindAfterAction="@fun:fun_after_save()"
>
    <script>
        function fun_before_save(this_){
            var coverAccess = $(this_).attr("coverAccess")
            $(".js_myDataSave_popup").attr("access", coverAccess)
        }
        function fun_after_save(){
            $(this).find(".close").trigger("click")
        }
    </script>
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">输入框</h4>
      </div>
      <div class="modal-body">
        <div class="row">
        <c:forEach items="${formContext.infos}" var="formInfo">
            <div class='form-group col-lg-12' 
             com="myValidate" fieldName="${formInfo.fieldName}">
                <div class="form-group has-feedback">
                    <!-- S 名称 -->
                    <label class="col-lg-3 col-sm-2 control-label" for="${formInfo.fieldName}" >
                        ${formInfo.comment} <c:if test="${!formInfo.nullable}"><span style="color:red;">*</span></c:if>
                    </label>
                    <!-- E 名称 -->
                    <!-- S 表单 -->
                    <div class="col-lg-9">
                        <c:if test="${formInfo.type=='Text'}">
                        <input class="form-control" id="${formInfo.fieldName}" name="${formInfo.fieldName}" value="${bean[formInfo.fieldName]}" />
                        <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
                        <!-- S 消息 -->
                        <p com="myMessage" class="help-block" >
                        <c:forEach items="${formInfo.validateInfos}" var="info">
                            <c:if test="${info.name=='ValidateMinLength' || info.name=='ValidateMaxLength'}" >
                            ${info.description}!
                            </c:if>
                        </c:forEach>
                        </p>
                        <!-- E 消息 -->
                        </c:if>
                    </div>
                </div>
                <!-- E 表单 -->
            </div>
        </c:forEach>
        <!-- E 表单组 -->
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" com-fire="myDataSave" >提交</button>
      </div>
    </div>
  </div>
</div>
<%-- E 弹出框  --%>